<?php
namespace app\m\controller;

use app\common\controller\FrontController;
use app\common\service\MemberService;
use app\common\service\OrderService;

class My extends FrontController
{
    public function index()
    {
        $memberService = new MemberService();
        $jieguo = $memberService->getMemberInfo($this->getMemberId());
        if($jieguo['err_code'] != 0){
            $this->error($jieguo['msg']);
        }
        $memberModel = $jieguo['data'];

        $this->assign('memberModel', $memberModel);

        // 订单信息
        $orderService = new OrderService();
        $jieguo = $orderService->getMyOrderStatusNum($this->getMemberId());
        if($jieguo['err_code'] != 0){
            $this->error($jieguo['msg']);
        }
        $myOrderStatusNum = $jieguo['data'];

        $this->assign('myOrderStatusNum', $myOrderStatusNum);
        return $this->fetch();
    }
}
